using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Dal.Entities;

namespace Dal.Mapping
{
	public class Doc1Map : EntityTypeConfiguration<Doc1>
	{
		public Doc1Map()
		{
			// Primary Key
			this.HasKey(t => t.DocID);

			// Properties
			this.Property(t => t.DocID)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.PatientName)
				.HasMaxLength(50);
				
			this.Property(t => t.Mobile)
				.HasMaxLength(50);
				
			this.Property(t => t.FamilyAddress)
				.HasMaxLength(100);
				
			this.Property(t => t.Diseases)
				.HasMaxLength(500);
				
			this.Property(t => t.Income)
				.HasMaxLength(50);
				
			this.Property(t => t.Education)
				.HasMaxLength(50);
				
			this.Property(t => t.Job)
				.HasMaxLength(50);
				
			this.Property(t => t.Insurance)
				.HasMaxLength(50);
				
			this.Property(t => t.AdditionDisease)
				.HasMaxLength(50);
				
			this.Property(t => t.AdditionInsurance)
				.HasMaxLength(50);
				
			this.Property(t => t.AdditionInsuranceIntro)
				.HasMaxLength(50);
				
			this.Property(t => t.AdditionJob)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("Doc1");
			this.Property(t => t.DocID).HasColumnName("DocID");
			this.Property(t => t.PatientName).HasColumnName("PatientName");
			this.Property(t => t.Sex).HasColumnName("Sex");
			this.Property(t => t.Age).HasColumnName("Age");
			this.Property(t => t.Mobile).HasColumnName("Mobile");
			this.Property(t => t.FamilyAddress).HasColumnName("FamilyAddress");
			this.Property(t => t.Height).HasColumnName("Height");
			this.Property(t => t.Weight).HasColumnName("Weight");
			this.Property(t => t.DiagnoseTime).HasColumnName("DiagnoseTime");
			this.Property(t => t.FamilyHistory).HasColumnName("FamilyHistory");
			this.Property(t => t.Diseases).HasColumnName("Diseases");
			this.Property(t => t.Income).HasColumnName("Income");
			this.Property(t => t.Education).HasColumnName("Education");
			this.Property(t => t.Job).HasColumnName("Job");
			this.Property(t => t.Insurance).HasColumnName("Insurance");
			this.Property(t => t.Score).HasColumnName("Score");
			this.Property(t => t.AdditionDisease).HasColumnName("AdditionDisease");
			this.Property(t => t.AdditionInsurance).HasColumnName("AdditionInsurance");
			this.Property(t => t.AdditionInsuranceIntro).HasColumnName("AdditionInsuranceIntro");
			this.Property(t => t.AdditionJob).HasColumnName("AdditionJob");
			this.Property(t => t.StatusAudit).HasColumnName("StatusAudit");
			this.Property(t => t.StatusComplete).HasColumnName("StatusComplete");
		}
	}
}

